/**
 * @date 2:30:24 PM
 * EducationSubjectUnit.java
 * Administrator
 * TODO
 */
package com.qs.education.bean.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import lombok.Getter;
import lombok.Setter;

/**
 * @class EducationSubjectUnit	
 * @author Warren
 * @description
 * @date Nov 14, 2018 
 */
@Entity
@Table(name="education_subject_unit")
@Setter
@Getter
public class EducationSubjectUnit {
	@Id
	@Column(name="id" ,unique=true,nullable=false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	private String title;
	
	@ManyToOne
	@JoinColumn(name="subject_id")
	private EducationSubject subject;
	
	@ManyToOne
	@JoinColumn(name="grade_id")
	private EducationGrade grade;
	
	@OneToMany
	@JoinColumn(name="unit_id")
	@JsonIgnoreProperties(value = { "unit" , "questionList" ,"homeworkList"})	
	private List<EducationSubjectLesson> subjectLessonList;
}
